package com.rem.designPattern.observer观察者;

/**
 * @author Rem
 * @date 2022-11-25
 */
public class Client {
    public static void main(String[] args) {
        SubscriptionSubject subscriptionSubject = new SubscriptionSubject();
        WeixinUser zhangsan = new WeixinUser("zhangsan");
        zhangsan.follow(subscriptionSubject);

        WeixinUser lisi = new WeixinUser("lisi");
        lisi.follow(subscriptionSubject);

        WeixinUser wangwu = new WeixinUser("wangwu");
        wangwu.follow(subscriptionSubject);

        subscriptionSubject.notify("世界杯开始啦～～～");

        wangwu.cancel(subscriptionSubject);
        subscriptionSubject.notify("沙特赢啦～～～");
    }
}